package net.geektao.lab.spring.springutil;

import org.springframework.beans.factory.InitializingBean;

/**
 * Spring Bean调用MyUtil。
 * 
 * @author geektao
 *
 */
public class BeanUseMyUtil implements InitializingBean {

	public void print() {
		/** 输出MyUtil.getConfig()值 */
		try {
			System.out.println("MyUtil.getConfig()值为“" + MyUtil.getConfig() + "”");
		} catch (IllegalStateException e) {
			System.out.println("调用MyUtil.getConfig()报:" + e.getMessage());
		}
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		/** 本 Bean属性设置后马上调用print(). */
		this.print();
	}
}
